<template>
  <!-- <BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
    <BasicForm @register="registerForm" />
  </BasicModal> -->
    <!-- 添加或修改流程分类对话框 -->
  <el-dialog :title="title" v-model="open" width="600px" append-to-body>
      <el-form ref="deptRef" :model="form" :rules="rules" label-width="80px">
        <el-row>
            <el-col :span="24" label="名称" v-if="form.name !== 0">
              <el-input v-model="form.name" placeholder="请输入名称" maxlength="200"/>
            </el-col>
            <el-col :span="24">
              <el-form-item label="编码" prop="code">
                  <el-input v-model="form.deptName" placeholder="请输入编码" />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="简称" prop="shortName">
                <el-input v-model="form.shortName" placeholder="请输入简称" maxlength="200"/>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="所属公司" prop="companyId">
                <el-tree-select
                        v-model="form.companyId"
                        :data="deptOptions"
                        :props="{ value: 'deptId', label: 'deptName', children: 'children' }"
                        value-key="deptId"
                        placeholder="选择上级部门"
                        check-strictly
                     />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="排序号" prop="orderNo">
                  <el-input v-model="form.orderNo" placeholder="请输入排序号" />
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="状态" prop="frontShow">
                <el-switch
                  v-model="scope.row.frontShow"
                  active-value="0"
                  inactive-value="1"
                  @change="handleStatusChange(scope.row)"
               ></el-switch>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-form-item label="描述">
                <el-input v-model="form.remark" type="textarea" placeholder="请输入描述"></el-input>
              </el-form-item>
            </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
            <el-button type="primary" @click="submitForm">确 定</el-button>
            <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
  </el-dialog>
</template>
<script setup>
  import { defineComponent, ref, computed, unref } from 'vue';
  const props = defineProps(["open",'title'])
  

</script>
